package com.gitee.huanminabc.fastboot.web.validation;

import com.gitee.huanminabc.fastboot.exception.ValidationException;
import com.gitee.huanminabc.fastboot.web.annotation.validation.NotNull;

import java.lang.annotation.Annotation;

/**
 * @description:
 * @author: huanmin
 * @create: 2025-04-02 15:11
 **/
public class NotNullValidationVerify implements ValidationVerify {
    @Override
    public Class<?> getAnnotation() {
        return NotNull.class;
    }
    @Override
    public void verify(Object value, Annotation annotation,String gprmc) {
        NotNull notNull = (NotNull) annotation;
        if (value == null) {
            throw new ValidationException(this.gprmcMerge(gprmc,notNull.message()));
        }
    }
}
